class clusters::snmp {
  package {"net-snmp":
    ensure    => 'installed',
    require   => Yumrepo['site'],
  } ->
  file {"/usr/lxslc":
    ensure  =>  directory
  } ->
  file {"/usr/lxslc/sbin":
    ensure  =>  directory
  } ->
  file {"/usr/lxslc/sbin/forloadbalance.sh":
    mode       =>  '0755',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/forloadbalance.sh",
  } ->
  file {"/usr/lxslc/sbin/lbclient":
    mode       =>  '0755',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/lbclient-sl${operatingsystemmajrelease}",
  } ->
  file {"/etc/snmp/snmpd.conf":
    mode       =>  '0644',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/snmpd.conf",
  } ~>

  case $operatingsystemmajrelease {
    '6': {
         file {"/etc/sysconfig/snmpd":
           mode       =>  '0644',
           owner      =>  'root',
           group      =>  'root',
           source     =>  "puppet:///modules/${module_name}/sysconfig_snmpd_cenots6",
          }
         }

    '7': {
         file {"/etc/sysconfig/snmpd":
           mode       =>  '0644',
           owner      =>  'root',
           group      =>  'root',
           source     =>  "puppet:///modules/${module_name}/sysconfig_snmpd_cenots7",
          } 
         }
  } ~>

  service { "snmpd":
    ensure     => running,
    hasstatus  => true,
    hasrestart => true,
    enable     => true,
    require    =>  [ Package['net-snmp'], File['/etc/sysconfig/snmpd'], File['/etc/snmp/snmpd.conf'] ]
  }
}
